package oop3;

/**
 * Created with IntelliJ IDEA.
 * ClassName: CircleTest
 * Package: oop3
 * Description:
 * User: fzykd
 *
 * @Author: LQH
 * Date: 2023-11-23
 * Time: 16:19
 */

public class CircleTest {

    public static void main(String[] args) {
        Circle c1 = new Circle();

        System.out.println(c1);

        Circle c2 = new Circle();
        System.out.println(c2);

        System.out.println(Circle.total);


    }

}


class Circle {

    private double radius;

    private int id;

    //记录圆的个数 静态化
    static int total;

    //希望Id自定复制

    public Circle() {
        this.id = init;
        init++;
        total++;
    }

    //这个变量 是共享变量 要static修饰
    private static int init = 1001;


    @Override
    public String toString() {
        return "Circle{" +
                "radius=" + radius +
                ", id=" + id +
                '}';
    }
}